// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
//引入全局css文件
import '@/assets/css/global.css'
Vue.config.productionTip = false
//引入el-element
import '@/element'
import 'element-ui/lib/theme-chalk/index.css'
//引入axios
import axios from 'axios'
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1' //配置请求根路径
axios.interceptors.request.use(config => {  //请求拦截，为header添加token
  config.headers.Authorization = sessionStorage.getItem('token');
  return config;
})
Vue.prototype.$http = axios;
//引入tree-grid
import TreeTable from 'vue-table-with-tree-grid';
Vue.component('tree-table', TreeTable);


/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
